import React, { Component } from 'react';
import Markdown  from 'react-markdown';




class JsPage extends Component {
    constructor(props) {
        super(props);
    }




    render() {

        return (
            <div>
                <Markdown source={"Docker 是一个打包、 分发和运行应用程序的平台。 正如我们所说， 它允许将你的应用程序和应用程序所依赖的整个环境打包在一起。 这既可以是一些应用程序需要的库， 也可以是一个被安装的操作系统所有可用的文件。 Docker 使得传输这个包到一个中央仓库成为可能， 然后这个包就能被分发到任何运行 Docker 的机器上， 在那儿被执行。\n\n当你用 Docker 运行一个被打包的应用程序时， 它能看见你捆绑的文件系统的内容， 不管运行在开发机器还是生产机器上， 它都能看见相同的文件， 即使生产机器运行的是完全不同的操作系统。 应用程序不会关心它所在服务器上的任何东西， 所以生产服务器上是否安装了和你开发机完全相同的一组库是不需要关心的。\n\n" +
                "安装docker\n\n" +
                "参考 :\n\nhttps://www.runoob.com/docker/centos-docker-install.html\n\nhttps://www.cnblogs.com/stulzq/p/7743073.html\n\n" +
                "安装Minikube\n\n参考: https://www.jianshu.com/p/18441c7434a6\n\nhttps://www.cnblogs.com/hongdada/p/9771857.html\n\n" +
                "首先记住阿里云发布的minikube地址：\n\nhttps://github.com/AliyunContainerService/minikube\n\n" +
                "从release目录下载最新的minikube版本\n\n" +
                "chmod +x minikube\n\n" +
                "mv minikube /usr/local/bin\n\n之后就可以启动了:\n\n" +
                "minikube start --registry-mirror=https://registry.docker-cn.com\n\n" +
                "VBoxManage not found\n\n" +
                "解决办法是安装 VirtualBox【对于windows或者mac】 再重新启动；当然如果你是Linux，也可以执行如下命令启动minikube，此时就不需要安装VirtualBox了\n\n" +
                "```" +
                "# linux 下独有，不依赖虚拟机启动\n" +
                " minikube start --vm-driver=none  \n" +
                "# 如果是Mac or Windows，安装VirtualBox后再重新start即可\n" +
                " minikube start\n\n" +
                "```\n\n" +
                "如果有错误就通过minikube delete，删除当前虚拟机，然后再运行带参数的start命令直到成功。\n\n" +
                "firewalld is active, please ensure ports\n\n" +
                "关闭防火墙\n\n```\n\n" +
                "执行关闭命令: systemctl stop firewalld.service\n" +
                "再次执行查看防火墙命令: systemctl status firewalld.service\n" +
                "执行开机禁用防火墙自启命令:systemctl disable firewalld.service\n" +
                "```\n\n" +
                "静态ip\n\n" +
                "cd  /etc/sysconfig/network-scripts\n\n" +
                "```" +
                "DEVICE=\"eth0\"  \n" +
                "BOOTPROTO=\"static\"  \n" +
                "DNS1=\"192.168.159.2\"  \n" +
                "GATEWAY=\"192.168.159.2\"  \n" +
                "IPADDR=\"192.168.159.132\"  \n" +
                "HWADDR=\"00:0C:29:7D:53:91\"  \n" +
                "IPV6INIT=\"yes\"  \n" +
                "NM_CONTROLLED=\"yes\"  \n" +
                "ONBOOT=\"yes\"  \n" +
                "TYPE=\"Ethernet\"  \n" +
                "UUID=\"0118dce9-bdf0-4103-9baf-16b1269027dd\" \n" +
                "```\n\nDocker中的Cgroup Driver:Cgroupfs 与 Systemd\n\ndocker info查看\n\n" +
                "改为Cgroup Driver: systemd\n\n修改或创建/etc/docker/daemon.json，加入下面的内容：\n\n" +
                "```\n\n" +
                "{\n" +
                "  \"exec-opts\": [\"native.cgroupdriver=systemd\"]\n" +
                "}\n" +
                "```\n\n重启docker:\n\n" +
                "systemctl restart docker\n\n" +
                "systemctl status docker\n\nrunning with swap on is not supported. Please disable swap\n\nsudo swapoff -a\n\nebtables not found in system path\n\nyum install -y ebtables\n\n" +
                "bridge-nf-call-iptables contents are not set to 1\n\necho 1 > /proc/sys/net/bridge/bridge-nf-call-iptables\n\n" +
                "        echo 1 > /proc/sys/net/bridge/bridge-nf-call-ip6tables\n\n" +
                "ailed to pull image k8s.gcr.io/kube-apiserver:\n\n解决方法：\n\n" +
                "```" +
                "\n:v1.14.2\n" +
                "docker pull mirrorgooglecontainers/kube-apiserver-amd64:v1.11.3\n" +
                "docker pull mirrorgooglecontainers/kube-controller-manager-amd64:v1.11.3\n" +
                "docker pull mirrorgooglecontainers/kube-scheduler-amd64:v1.11.3\n" +
                "docker pull mirrorgooglecontainers/kube-proxy-amd64:v1.11.3\n" +
                "docker pull mirrorgooglecontainers/pause:3.1\n" +
                "docker pull mirrorgooglecontainers/etcd-amd64:3.2.18\n" +
                "docker pull coredns/coredns:1.1.3\n" +
                "docker pull mirrorgooglecontainers/storage-provisioner:v1.8.1\n" +
                "```\n\n参考 https://blog.csdn.net/u010652906/article/details/86075437\n\n 版本信息需要根据实际情况进行相应的修改。通过docker tag命令来修改镜像的标签:\n\n" +
                "```" +
                "\n" +
                "docker tag docker.io/mirrorgooglecontainers/kube-proxy-amd64:v1.11.3 k8s.gcr.io/kube-proxy-amd64:v1.11.3\n" +
                "docker tag docker.io/mirrorgooglecontainers/kube-scheduler-amd64:v1.11.3 k8s.gcr.io/kube-scheduler-amd64:v1.11.3\n" +
                "docker tag docker.io/mirrorgooglecontainers/kube-apiserver-amd64:v1.11.3 k8s.gcr.io/kube-apiserver-amd64:v1.11.3\n" +
                "docker tag docker.io/mirrorgooglecontainers/kube-controller-manager-amd64:v1.11.3 k8s.gcr.io/kube-controller-manager-amd64:v1.11.3\n" +
                "docker tag docker.io/mirrorgooglecontainers/etcd-amd64:3.2.18  k8s.gcr.io/etcd-amd64:3.2.18\n" +
                "docker tag docker.io/mirrorgooglecontainers/pause:3.1  k8s.gcr.io/pause:3.1\n" +
                "docker tag docker.io/coredns/coredns:1.1.3  k8s.gcr.io/coredns:1.1.3\n" +
                "```\n\n" +
                "查看docker镜像docker images：\n\n" +
                "添加镜像后需要重启docker,\n\n" +
                "minikube还是启动报错，不得不使用:\n\n" +
                "```\n" +
                "cat <<EOF > /etc/yum.repos.d/kubernetes.repo\n" +
                "[kubernetes]\n" +
                "name=Kubernetes\n" +
                "baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64\n" +
                "enabled=1\n" +
                "gpgcheck=0\n" +
                "repo_gpgcheck=0\n" +
                "gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg\n" +
                "http://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg\n" +
                "EOF\n\n" +
                "```\n\n" +
                "yum install -y kubectl\n\n" +
                "minikube start --vm-driver=none\n\n" +
                "It seems like the kubelet isn't running or healthy.\n\n" +
                "systemctl status kubelet\n\n" +
                ""}/>



            </div>
        );
    }
}

export default JsPage;